home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Source Code / C / Applications / Moscow ML 1.31 / source code / mosml / src / runtime / config.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-07-03  |  4.0 KB  |  160 lines  |  [TEXT/R*ch]

  1. #ifndef _config_
  2. #define _config_
  3.  
  4.  
  5. #if defined(__MWERKS__) || defined(THINK_C)
  6. #include "m.h"
  7. #include "s.h"
  8. #else
  9. #ifdef macintosh
  10. #include ":::config:m.h"
  11. #include ":::config:s.h"
  12. #else
  13. #include "../config/m.h"
  14. #include "../config/s.h"
  15. #endif
  16. #endif
  17.  
  18. /* Library dependencies */
  19.  
  20. #ifdef HAS_MEMMOVE
  21. #define bcopy(src,dst,len) memmove((dst), (src), (len))
  22. #else
  23. #ifdef HAS_BCOPY
  24. /* Nothing to do */
  25. #else
  26. #ifdef HAS_MEMCPY
  27. #define bcopy(src,dst,len) memcpy((dst), (src), (len))
  28. #else
  29. #define bcopy(src,dst,len) memmov((dst), (src), (len))
  30. #define USING_MEMMOV
  31. #endif
  32. #endif
  33. #endif
  34.  
  35. #ifndef HAS__SETJMP
  36. #define _setjmp setjmp
  37. #define _longjmp longjmp
  38. #endif
  39.  
  40. /* Signed char type */
  41.  
  42. #if defined(__STDC__) || defined(SIGNED_CHAR_WORKS)
  43. typedef signed char schar;
  44. #else
  45. typedef char schar;
  46. #endif
  47.  
  48. /* Do not change this definition. */
  49. #define Page_size (1 << Page_log)
  50.  
  51. /* Memory model parameters */
  52.  
  53. #if !defined(SMALL) && !defined(SIXTEEN)
  54.  
  55. /* The size of a page for memory management (in bytes) is [1 << Page_log].
  56.    It must be a multiple of [sizeof (long)]. */
  57. #define Page_log 12             /* A page is 4 kilobytes. */
  58.  
  59. /* Initial sizes of stacks (bytes). */
  60. #define Arg_stack_size 16384
  61. #define Ret_stack_size 16384
  62.  
  63. /* Minimum free size of stacks (bytes); below that, they are reallocated. */
  64. #define Arg_stack_threshold 1024
  65. #define Ret_stack_threshold 1024
  66.  
  67. /* Maximum sizes for the stacks (bytes). */
  68.    
  69. #ifdef MINIMIZE_MEMORY
  70. #define Max_arg_stack_size 131072
  71. #define Max_ret_stack_size 131072
  72. #else
  73. #define Max_arg_stack_size 524288
  74. #define Max_ret_stack_size 524288
  75. #endif
  76.  
  77. /* Maximum size of a block allocated in the young generation (words). */
  78. /* Must be > 4 */
  79. #define Max_young_wosize 256
  80.  
  81.  
  82. /* Minimum size of the minor zone (words).
  83.    This must be at least [Max_young_wosize + 1]. */
  84. #define Minor_heap_min 4096
  85.  
  86. /* Maximum size of the minor zone (words).
  87.    Must be greater than or equal to [Minor_heap_min].
  88. */
  89. #define Minor_heap_max (1 << 28)
  90.  
  91. /* Default size of the minor zone. (words)  */
  92. #define Minor_heap_def 32768
  93.  
  94.  
  95. /* Minimum size increment when growing the heap (words).
  96.    Must be a multiple of [Page_size / sizeof (value)]. */
  97. #define Heap_chunk_min (2 * Page_size / sizeof (value))
  98.  
  99. /* Maximum size of a contiguous piece of the heap (words).
  100.    Must be greater than or equal to [Heap_chunk_min].
  101.    Must be greater than or equal to [Bhsize_wosize (Max_wosize)]. */
  102. #define Heap_chunk_max (Bhsize_wosize (Max_wosize))
  103.  
  104. /* Default size increment when growing the heap. (bytes)
  105.    Must be a multiple of [Page_size / sizeof (value)]. */
  106. #define Heap_chunk_def (62 * Page_size / sizeof (value))
  107.  
  108.  
  109. /* Default speed setting for the major GC.  The heap will grow until
  110.    the dead objects and the free list represent this percentage of the
  111.    heap size.  The rest of the heap is live objects. */
  112. #define Percent_free_def 30
  113.  
  114.  
  115. #else
  116. #ifdef SIXTEEN                 /* Scaled-down parameters for 16-bit machines */
  117.  
  118. #define Page_log 10
  119. #define Arg_stack_size 16384
  120. #define Ret_stack_size 16384
  121. #define Arg_stack_threshold 1024
  122. #define Ret_stack_threshold 1024
  123. #define Max_arg_stack_size 49152
  124. #define Max_ret_stack_size 49152
  125. #define Max_young_wosize 256
  126. #define Minor_heap_min 512
  127. #define Minor_heap_max 0x3F00
  128. #define Minor_heap_def 8192
  129. #define Heap_chunk_min 0x400
  130. #define Heap_chunk_max 0x3C00
  131. #define Heap_chunk_def 0x2000
  132. #define Percent_free_def 15
  133.  
  134. #else
  135. #ifdef SMALL                   /* Scaled-down parameters for small memory */
  136.  
  137. #define Page_log 10
  138. #define Arg_stack_size 16384
  139. #define Ret_stack_size 16384
  140. #define Arg_stack_threshold 1024
  141. #define Ret_stack_threshold 1024
  142. #define Max_arg_stack_size 524288
  143. #define Max_ret_stack_size 524288
  144. #define Max_young_wosize 256
  145. #define Minor_heap_min 1024
  146. #define Minor_heap_max (1 << 28)
  147. #define Minor_heap_def 16384
  148. #define Heap_chunk_min (2 * Page_size / sizeof (value))
  149. #define Heap_chunk_max (1 << 28)
  150. #define Heap_chunk_def (126 * Page_size / sizeof (value))
  151. #define Percent_free_def 20
  152.  
  153. #endif /* SMALL */
  154. #endif /* SIXTEEN */
  155.  
  156. #endif /* !defined(SMALL) && !defined(SIXTEEN) */
  157.  
  158.  
  159. #endif /* _config_ */
  160.